<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
  <head>
    <title>LayerDef</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>

    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjU0EJWnWPMv7oQ-jjS7dYxQGj0PqsCtxKvarsoS-iqLdqZSKfxRdmoPmGl7Y9335WLC36wIGYa6o5Q" type="text/javascript">
    </script>
    <script type="text/javascript">
         document.write('<script type="text/javascript" src="../src/arcgislink'+(document.location.search.indexOf('packed')>-1?'_packed':'')+'.js"><'+'/script>');
    </script>
    <script type="text/javascript">
    var gmap = null;
    var dynaLayer=null;
    function init(){
      var tiled = new ArcGISTileLayer('http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer');
      GEvent.addListener(tiled, 'load', function(){
        gmap = new GMap2(document.getElementById("map"), {
          mapTypes: [new ArcGISMapType([tiled])]
        });
        
        gmap.setBounds(new GLatLngBounds(new GLatLng(36.8,-103),new GLatLng(40.2,-94)));
        gmap.addControl(new GLargeMapControl());
        gmap.addControl(new GMapTypeControl());
        gmap.enableScrollWheelZoom();
        
        dynaLayer = new ArcGISMapOverlay("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer");
        GEvent.addListener(dynaLayer, 'load', function(){
          var service=dynaLayer.getMapService();
          service.getLayer("Coarse Counties").definition="STATE_NAME='Kansas' and POP2007>25000";
          service.getLayer("Detailed Counties").definition="STATE_NAME='Kansas' and POP2007>25000";
          service.getLayer("states").definition="STATE_NAME='Kansas'";
          gmap.addOverlay(dynaLayer);
         
        });
      });
      
      
    }
    
   
    
    
  </script>

  </head>
   <body onload='init()' onunload='GUnload()'>
        <a href='../docs/examples.html'>More examples</a> | Use
       <a href='?packed'>Packed </a> | 
       <a href='?'> Unpacked</a> Version of the script.
       <br/> This example was modeled from <a href='http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/demos/map/map_multiplelayerdef.html'>
       http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/demos/map/map_multiplelayerdef.html</a>
       
       <br/>
       
        <div id="map" style="width:900px; height:600px; border:1px solid #000;"></div>
    </body>
 
</html>